/*
 * HttpFactory.cpp
 *
 *  Created on: 2022-05-07
 *      Author: chuanjiang.zh
 */

#include "HttpFactory.h"
#include "CHttpClient.h"
#include "CHttpServer.h"

HttpFactory::HttpFactory()
{
}

HttpFactory::~HttpFactory()
{
}

HttpClient* HttpFactory::createClient()
{
    return new CHttpClient();
}

void HttpFactory::destroyClient(HttpClient* client)
{
    if (client)
    {
        client->close();
        delete client;
    }
}

HttpServer* HttpFactory::createServer()
{
    return new CHttpServer();
}

void HttpFactory::destroyServer(HttpServer* server)
{
    if (server)
    {
        server->stop();
        delete server;
    }
}
